﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GestionPedago.EntityContext;
using Persistence.OPManager;


namespace ConsoleBidon
{
    class Program
    {
        static void Main(string[] args)
        { 
           /* Formation f = FormationOPManager.GetFormationByCode("CDI");
            List<ECF> lst = f.GetListeECFAPasser();
            foreach(ECF e in lst){
                Console.WriteLine(e.Libelle);
            }*/
          //  ECF ec = EntityConnection.GetContext().CreateObject<ECF>();
            ECF ec = new ECF();
           
            ec.IdECF = 1;
            EntityConnection.GetContext().ECF.Attach(ec);
            VersionECF ve = new VersionECF();
            ve.Commentaire = "pouet";
            ve.Libelle = "pouet";
            ve.IdVersionECF = 3;
            EntityConnection.GetContext().VersionECF.Attach(ve);
            ec.VersionECF.Add(ve);
            ec.Libelle = "Test MiseAJour 2";
            ec.MiseAjour();
          //  ECFOPManager.AjouterECF(ec);
           // Console.WriteLine("bite");

            foreach(ECF e in ECFOPManager.GetListeECF(null,null)){
               /* if (e.IdECF == 1)
                {
                    e.Libelle = "Test miseAJour";
                    e.MiseAjour();
                }*/
                Console.WriteLine(e.Libelle);
            }
            Console.ReadLine();
        }
    }
}
